---
title: Install Mojo
description: You can install Mojo using pixi, uv, conda, pip, or other Python/Conda package managers.
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Requirements from '@site/src/components/Requirements';
import { requirementsNoGPU } from '@site/docs/max/requirements';

You can install Mojo as a Python or Conda package. This page shows you how to
install using `pixi`, `uv`, `pip`, and `conda`, but you can use other tools.

:::note Start coding

For a beginner's guide to Mojo, instead see the [get started
tutorial](/mojo/manual/get-started), which includes installation steps.

:::

System requirements:

<Requirements requirementsData={requirementsNoGPU}
url="/mojo/manual/install#system-requirements" />

## Install

To get the latest version, we recommend installing our nightly build. If you
want a better tested but older version, install the stable build. Both
options are shown below.

:::tip

For the most reliable experience, we recommend using
[Pixi](https://pixi.sh/latest/). It's both a package manager and virtual
environment manager—which alone makes development a lot easier—but it's also
fast, language agnostic, and provides lock files for package dependencies. For
more help with it, see our [Pixi basics guide](/pixi).

:::


<Tabs groupId="install">
<TabItem value="pixi" label="pixi" default>

1. If you don't have it, install `pixi`:

    ```sh
    curl -fsSL https://pixi.sh/install.sh | sh
    ```

2. Navigate to the directory where you want to create a project
    and run this:

    ```bash
    pixi init hello-world \
      -c https://conda.modular.com/max-nightly/ -c conda-forge \
      && cd hello-world
    ```

    This creates a project directory named `hello-world`, adds the channel
    for Modular conda packages, and enters the directory.

    :::tip

    **Tip:**
    You can remove the `-c` options if you [specify default
    channels](/pixi#create-a-project-and-virtual-environment).

    :::

3. Install Mojo:

    <Tabs groupId="release">
      <TabItem value="nightly" label="Nightly">

        ```sh
        pixi add mojo
        ```

      </TabItem>
      <TabItem value="stable" label="Stable">

        ```sh
        pixi add "mojo==0.25.7"
        ```

      </TabItem>
    </Tabs>

4. Enter the virtual environment so you can access the `mojo` CLI:

    ```sh
    pixi shell
    ```


</TabItem>
<TabItem value="uv" label="uv">

1. If you don't have it, install `uv`:

    ```sh
    curl -LsSf https://astral.sh/uv/install.sh | sh
    ```

    Then restart your terminal to make uv accessible.

2. Create a project:

    ```sh
    uv init hello-world && cd hello-world
    ```

3. Create and start a virtual environment:

    ```sh
    uv venv && source .venv/bin/activate
    ```

4. Install Mojo:

    <Tabs groupId="release">
      <TabItem value="nightly" label="Nightly">

        ```sh
        uv pip install mojo \
          --index-url https://dl.modular.com/public/nightly/python/simple/ \
          --prerelease allow
        ```

        </TabItem>
        <TabItem value="stable" label="Stable">

        ```sh
        uv pip install mojo \
          --extra-index-url https://modular.gateway.scarf.sh/simple/
        ```

        </TabItem>
      </Tabs>


</TabItem>
<TabItem value="pip" label="pip">

1. Create a project folder:

    ```sh
    mkdir hello-world && cd hello-world
    ```

2. Create and activate a virtual environment:

    ```sh
    python3 -m venv .venv/hello-world \
      && source .venv/hello-world/bin/activate
    ```

3. Install Mojo:

    <Tabs groupId="release">
      <TabItem value="nightly" label="Nightly">

        ```sh
        pip install --pre mojo \
          --index-url https://dl.modular.com/public/nightly/python/simple/
        ```

        </TabItem>
        <TabItem value="stable" label="Stable">

        ```sh
        pip install mojo \
          --extra-index-url https://modular.gateway.scarf.sh/simple/
        ```

        </TabItem>
      </Tabs>


</TabItem>
<TabItem value="conda" label="conda">

1. If you don't have it, install conda. A common choice is to use
   [Homebrew](https://brew.sh/):

    ```sh
    brew install miniconda
    ```

2. Initialize conda for shell interaction:

    ```sh
    conda init
    ```

    If you're on a Mac, instead use:

    ```sh
    conda init zsh
    ```

    Then restart your terminal for the changes to take effect.

3. Create a project:

    ```sh
    conda create -n hello-world
    ```

4. Start the virtual environment:

    ```sh
    conda activate hello-world
    ```

5. Install Mojo:

    <Tabs groupId="release">
      <TabItem value="nightly" label="Nightly">

        ```sh
        conda install -c conda-forge \
          -c https://conda.modular.com/max-nightly/ mojo
        ```

        </TabItem>
        <TabItem value="stable" label="Stable">

        ```sh
        conda install -c conda-forge \
          -c https://conda.modular.com/max/ "mojo==0.25.7"
        ```

        </TabItem>
      </Tabs>

</TabItem>
</Tabs>

Verify your installation by printing the Mojo version:

```sh
mojo --version
```

### Add the VS Code extension

If you're using [Visual Studio Code](https://code.visualstudio.com/) or another
IDE derived from it (such as [Cursor](https://cursor.com/home)), we recommend
installing the Mojo extension, which provides features like syntax highlighting,
code completion, and debugging support. You can install it from either:

- The
  [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=modular-mojotools.vscode-mojo),
  for VS Code users
- The
  [Open VSX Registry](https://open-vsx.org/extension/modular-mojotools/vscode-mojo),
  for users of Cursor and other editors that support VS Code extensions

Or, open the Extensions view in your IDE and search for "Mojo"—make sure you
install the extension from Modular.

:::note

Prior to the 0.25.6 Mojo release, there were two versions of the Mojo extension:
a stable version for working with the stable build of Mojo and a nightly version
for working with the nightly build of Mojo. Concurrent with the 0.25.6 Mojo
release, we've consolidated the two versions into a single extension that works
for both stable and nightly builds.

The new extension replaces the old stable version, so if you have the stable
version installed, you can simply update it to receive the new version. If you
have the nightly version of the extension installed, you should uninstall it and
install the regular (non-nightly) version.

:::

### Print "Hello world"

If you followed the installation steps above, your terminal should be in an
environment with `mojo` installed. To run some code, you just need a `.mojo`
file with a `main()` function:

1. Create a file named `hello.mojo` with this code:

    ```mojo title="hello.mojo"
    def main():
        print("Hello, World!")
    ```

2. Run it with the [`mojo`](/mojo/cli) CLI:

    ```sh
    mojo hello.mojo
    ```

    ```output
    Hello, World!
    ```

### Try some examples

The
[`examples/mojo/`](https://github.com/modular/modular/tree/main/examples/mojo)
directory of our public [GitHub](https://github.com/modular/modular) repository
contains several examples of Mojo code that you can use to learn more about the
language and its standard library. Here's how to download and use them.

1. Clone the repository:

    ```sh
    git clone https://github.com/modular/modular.git
    ```

2. Navigate to one of the Mojo example subdirectories, such as the subdirectory
   containing the reference solution for the
   [Get started with Mojo](/mojo/manual/get-started) tutorial project, which is
   an implementation of [Conway's Game of
   Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) cellular
   automation:

    ```sh
    cd modular/examples/mojo/life
    ```

3. Use `pixi` to download and install the dependencies for the project and to
   build and run the examples. For example, to run the reference solution for
   the Game of Life tutorial project, use the following command:

    ```sh
    pixi run lifev1
    ```

    This displays a window that shows an initial random state for the grid and
    then automatically updates it with subsequent generations. Quit the program
    by pressing the `q` or `<Escape>` key or by closing the window.

    :::note

    If you're using a package manager other than `pixi`, make sure `mojo` is
    installed and accessible in your current shell environment. Consult the
    `README.md` file in the example project subdirectory for information about
    any other dependencies that need to be installed for that particular example
    project. (The Game of Life example requires a compatible Python runtime and
    the [pygame](https://www.pygame.org/) library.) Then run the example with
    the [`mojo`](/mojo/cli) CLI. For example, to run the reference solution for
    the Game of Life tutorial project, use the following command:

    ```sh
    mojo lifev1.mojo
    ```

    :::

## Update

The following commands should update your local `mojo` package if a new version
is available that's compatible with the version you specified when you
installed it or added it as a package dependency. For more information about
updating packages, see the docs for your package manager.

<Tabs groupId="install">
<TabItem value="pixi" label="pixi">

```sh
pixi update mojo
```

</TabItem>
<TabItem value="uv" label="uv">

```sh
uv sync --upgrade-package mojo
```

</TabItem>
<TabItem value="pip" label="pip">

```sh
pip install --upgrade mojo
```

</TabItem>
<TabItem value="conda" label="conda">

```sh
conda update mojo
```

</TabItem>
</Tabs>

## Uninstall

Mojo is installed as a Python or Conda package, so the normal package removal
process applies.

<Tabs groupId="install">
  <TabItem value="pixi" label="pixi">
  This removes the package from your local project:

  ```sh
  pixi remove mojo
  ```

  This deactivates your virtual environment:

  ```sh
  exit
  ```

  </TabItem>
  <TabItem value="uv" label="uv">
  This removes the package from your local environment:

  ```sh
  uv pip uninstall mojo && uv sync
  ```

  This deactivates your virtual environment:

  ```sh
  deactivate
  ```

  </TabItem>
  <TabItem value="pip" label="pip">
  This removes the package from your local environment:

  ```sh
  pip uninstall mojo
  ```

  However, this won't uninstall `mojo` dependencies, so some "sub packages"
  remain installed. Consider using
  [`pip-autoremove`](https://github.com/invl/pip-autoremove) or switch to a
  better package manager like Pixi.

  This deactivates your virtual environment:

  ```sh
  deactivate
  ```

  </TabItem>
  <TabItem value="conda" label="conda">
  This removes the package from your local project:

  ```sh
  conda remove mojo
  ```

  This deactivates your virtual environment:

  ```sh
  conda deactivate
  ```

  </TabItem>
</Tabs>

## What's included

We actually offer two Mojo packages: `mojo` and `mojo-compiler`.

For most situation, you want `mojo` because it includes all the developer tools
(it's a superset of the `mojo-compiler` package).

### `mojo`

This gives you everything you need for Mojo development.

Includes:

- [`mojo` CLI](/mojo/cli) (includes the Mojo compiler)
- [Mojo standard library](/mojo/lib)
- [`mojo` Python
  package](https://github.com/modular/modular/tree/main/mojo/python/mojo)
- Mojo language server (LSP) for IDE/editor integration
- [Mojo debugger](/mojo/tools/debugging) (includes LLDB)
- [Mojo code formatter](/mojo/cli/format)
- [Mojo REPL](/mojo/cli/repl)

### `mojo-compiler`

This package is smaller and is useful for environments where you only need to
call or build existing Mojo code. For example, this is good if you're running
Mojo in a production environment or when you're programming in Python and
[calling a Mojo package](/mojo/manual/python/mojo-from-python)—situations where
you don't need the LSP and debugger tools.

Includes:

- [`mojo` CLI](/mojo/cli) (includes the Mojo compiler)
- [Mojo standard library](/mojo/lib)
- [`mojo` Python
  package](https://github.com/modular/modular/tree/main/mojo/python/mojo)

## System requirements

To install `mojo` or `mojo-compiler`, your system must meet these
specifications.

<Tabs groupId="os">
<TabItem value="mac" label="Mac">

- macOS Ventura (13) or later
- Apple silicon (M1/M2/M3/M4 processor)
- Python 3.10 - 3.14
- Xcode or Xcode Command Line Tools
- We currently don't support Mac GPUs

</TabItem>
<TabItem value="linux" label="Linux">

- Ubuntu 22.04 LTS
- x86-64 CPU (with [SSE4.2 or
  newer](https://www.intel.com/content/www/us/en/support/articles/000057621/processors.html))
  or AWS Graviton2/3 CPU
- Minimum 8 GiB RAM
- Python 3.10 - 3.14
- g++ or clang++ C++ compiler
- To use GPUs, see the [GPU compatibility](#gpu-compatibility)

</TabItem>
<TabItem value="windows" label="Windows">

Windows is not officially supported at this time.

In the meantime, you can try Mojo on Windows [with
WSL](https://learn.microsoft.com/en-us/windows/wsl/install), using a compatible
version of Ubuntu (see our requirements for Linux).

</TabItem>
</Tabs>

### GPU compatibility

import GpuRequirements from '@site/docs/mojo/_includes/gpu-requirements.mdx';

Mojo supports both CPUs and GPUs, so you don't need a GPU to program with Mojo.
But if you do want to program for GPUs with Mojo, we recommend the following
GPUs.

<GpuRequirements />
